
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Configuring vim · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-page-footer-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles.css">
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="0.5.html" />
    
    
    <link rel="prev" href="0.3.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="PA0.html">
            
                <a href="PA0.html">
            
                    
                    PA0 - 世界诞生的前夜: 开发环境配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="0.1.html">
            
                <a href="0.1.html">
            
                    
                    Installing a GNU/Linux VM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="0.2.html">
            
                <a href="0.2.html">
            
                    
                    First Exploration with GNU/Linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="0.3.html">
            
                <a href="0.3.html">
            
                    
                    Installing Tools
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.4" data-path="0.4.html">
            
                <a href="0.4.html">
            
                    
                    Configuring vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="0.5.html">
            
                <a href="0.5.html">
            
                    
                    More Exploration
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="0.6.html">
            
                <a href="0.6.html">
            
                    
                    Transferring Files between host and container
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="0.7.html">
            
                <a href="0.7.html">
            
                    
                    Acquiring Source Code for PAs
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="PA1.html">
            
                <a href="PA1.html">
            
                    
                    PA1 - 洞察世界的视点: 简易调试器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="1.1.html">
            
                <a href="1.1.html">
            
                    
                    在开始愉快的PA之旅之前
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="1.2.html">
            
                <a href="1.2.html">
            
                    
                    RTFSC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="1.3.html">
            
                <a href="1.3.html">
            
                    
                    第三视点
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1" data-path="1.3.1.html">
            
                <a href="1.3.1.html">
            
                    
                    基本招式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2" data-path="1.3.2.html">
            
                <a href="1.3.2.html">
            
                    
                    有求必应
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.3" data-path="1.3.3.html">
            
                <a href="1.3.3.html">
            
                    
                    天网恢恢
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="1.4.html">
            
                <a href="1.4.html">
            
                    
                    武功秘笈
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="PA2.html">
            
                <a href="PA2.html">
            
                    
                    PA2 - 不停计算的机器: 指令系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="2.1.html">
            
                <a href="2.1.html">
            
                    
                    武功秘笈阅读指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="2.2.html">
            
                <a href="2.2.html">
            
                    
                    RTFSC(2)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="2.3.html">
            
                <a href="2.3.html">
            
                    
                    初出茅庐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="2.4.html">
            
                <a href="2.4.html">
            
                    
                    融会贯通
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="2.5.html">
            
                <a href="2.5.html">
            
                    
                    第三视点(2)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="2.6.html">
            
                <a href="2.6.html">
            
                    
                    三生万物
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="2.7.html">
            
                <a href="2.7.html">
            
                    
                    扭转乾坤
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="PA3.html">
            
                <a href="PA3.html">
            
                    
                    PA3 - 虚实交错的魔法: 存储管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="3.1.html">
            
                <a href="3.1.html">
            
                    
                    Cache的故事
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="3.2.html">
            
                <a href="3.2.html">
            
                    
                    IA-32的故事
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="3.2.1.html">
            
                <a href="3.2.1.html">
            
                    
                    混沌初开
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.2" data-path="3.2.2.html">
            
                <a href="3.2.2.html">
            
                    
                    建立新秩序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.3" data-path="3.2.3.html">
            
                <a href="3.2.3.html">
            
                    
                    迈进新时代
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.4" data-path="3.2.4.html">
            
                <a href="3.2.4.html">
            
                    
                    从一到无穷大
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="PA4.html">
            
                <a href="PA4.html">
            
                    
                    PA4 - 来自外部的声音: 中断与I/O
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="4.1.html">
            
                <a href="4.1.html">
            
                    
                    穿越时空的旅程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="4.2.html">
            
                <a href="4.2.html">
            
                    
                    时空之旅大揭秘
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="4.3.html">
            
                <a href="4.3.html">
            
                    
                    天外有天的世界
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="4.4.html">
            
                <a href="4.4.html">
            
                    
                    加入最后的拼图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="4.5.html">
            
                <a href="4.5.html">
            
                    
                    移植打字小游戏
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="4.6.html">
            
                <a href="4.6.html">
            
                    
                    通往高速的次元
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="4.7.html">
            
                <a href="4.7.html">
            
                    
                    移植仙剑奇侠传
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="4.8.html">
            
                <a href="4.8.html">
            
                    
                    编写不朽的传奇
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="blank.html">
            
                <a href="blank.html">
            
                    
                    杂项
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="why.html">
            
                <a href="why.html">
            
                    
                    为什么要学习计算机系统基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="submit.html">
            
                <a href="submit.html">
            
                    
                    实验提交要求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="linux.html">
            
                <a href="linux.html">
            
                    
                    Linux入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="man.html">
            
                <a href="man.html">
            
                    
                    man入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="git.html">
            
                <a href="git.html">
            
                    
                    git入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="i386-typo.html">
            
                <a href="i386-typo.html">
            
                    
                    i386手册勘误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="blank.html">
            
                <a href="blank.html">
            
                    
                    提交反馈
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.7.1" data-path="PA0-feedback.html">
            
                <a href="PA0-feedback.html">
            
                    
                    PA0提交情况
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7.2" data-path="PA1-feedback.html">
            
                <a href="PA1-feedback.html">
            
                    
                    PA1提交情况
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="feedback.html">
            
                <a href="feedback.html">
            
                    
                    收集课程感想
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >Configuring vim</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="configuring-vim">Configuring vim</h2>
<pre><code>apt-get install vim
</code></pre><p><code>vim</code> is called <a href="http://os.51cto.com/art/201101/242518.htm" target="_blank">&#x7F16;&#x8F91;&#x5668;&#x4E4B;&#x795E;</a>. You will use <code>vim</code> for coding in all PAs and Labs, as well as editing other files. Maybe some of you prefer to other editors requiring GUI environment (such Visual Studio). However, you can not use them in some situations, especially when you are accessing a physically remote server:</p>
<ul>
<li>the remote server does not have GUI installed, or</li>
<li>the network condition is so bad that you can not use any GUI tools.</li>
</ul>
<p>Under these situations, <code>vim</code> is still a good choice. If you prefer to <code>emacs</code>, you can download and install <code>emacs</code> from network mirrors.</p>
<h3 id="learning-vim">Learning vim</h3>
<p>You are going to be asked to modify a file using <code>vim</code>. For most of you, this is the first time to use <code>vim</code>. The operations in <code>vim</code> are quite different from other editors you have ever used. To learn <code>vim</code>, you need a tutorial. There are two ways to get tutorials:</p>
<ul>
<li>Issue the <code>vimtutor</code> command in terminal. This will launch a tutorial for <code>vim</code>. <font color="red">This way is recommended, since you can read the tutorial and practice at the same time.</font></li>
<li>Search the Internet with keyword &quot;vim &#x6559;&#x7A0B;&quot;, and you will find a lot of tutorials about <code>vim</code>. Choose some of them to read, meanwhile you can practice with the a temporary file by<pre><code>vim test
</code></pre></li>
</ul>
<font color="red">PRACTICE IS VERY IMPORTANT. You can not learn anything by only reading the tutorials.</font>

<p><div class="panel"><div class="box">Some games operated with vim</div><div class="word-in-panel"><p>Here are some games to help you master some basic operations in <code>vim</code>. Have fun!</p>
<ul>
<li><a href="http://vim-adventures.com" target="_blank">Vim Adventures</a></li>
<li><a href="http://www.vimsnake.com" target="_blank">Vim Snake</a></li>
<li><a href="http://www.openvim.com/tutorial.html" target="_blank">Open Vim Tutorials</a></li>
<li><a href="http://www.vimgenius.com" target="_blank">Vim Genius</a></li>
</ul>
</div></div></p>
<p><div class="panel"><div class="box">The power of vim</div><div class="word-in-panel"><p>You may never consider what can be done in such a &quot;BAD&quot; editor. Let&apos;s see two examples.</p>
<p>The first example is to generate the following file:</p>
<pre><code>1
2
3
.....
98
99
100
</code></pre><p>This file contains 100 lines, and each line contains a number. What will you do? In <code>vim</code>, this is a piece of cake. First change <code>vim</code> into normal state (when <code>vim</code> is just opened, it is in normal state), then press the following keys sequentially:</p>
<pre><code>i1&lt;ESC&gt;q1yyp&lt;C-a&gt;q98@1
</code></pre><p>where <code>&lt;ESC&gt;</code> means the ESC key, and <code>&lt;C-a&gt;</code> means &quot;Ctrl + a&quot; here. You only press no more than 15 keys to generate this file. Is it amazing? What about a file with 1000 lines? What you do is just to press one more key:</p>
<pre><code>i1&lt;ESC&gt;q1yyp&lt;C-a&gt;q998@1
</code></pre><p>The magic behind this example is recording and replaying. You initial the file with the first line. Then record the generation of the second. After that, you replay the generation for 998 times to obtain the file.</p>
<p>The second example is to modify a file. Suppose you have such a file:</p>
<pre><code>aaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeefffffffffffffffffffffffff
ggggggggggggggggggggggggghhhhhhhhhhhhhhhhhhhhhhhhh
iiiiiiiiiiiiiiiiiiiiiiiiijjjjjjjjjjjjjjjjjjjjjjjjj
</code></pre><p>You want to modify it into:</p>
<pre><code>bbbbbbbbbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaaaaaaaaaa
dddddddddddddddddddddddddccccccccccccccccccccccccc
fffffffffffffffffffffffffeeeeeeeeeeeeeeeeeeeeeeeee
hhhhhhhhhhhhhhhhhhhhhhhhhggggggggggggggggggggggggg
jjjjjjjjjjjjjjjjjjjjjjjjjiiiiiiiiiiiiiiiiiiiiiiiii
</code></pre><p>What will you do? In <code>vim</code>, this is a piece of cake, too. First locate the cursor to first &quot;a&quot; in the first line. And change <code>vim</code> into normal state, then press the following keys sequentially:</p>
<pre><code>&lt;C-v&gt;24l4jd$p
</code></pre><p>where <code>&lt;C-v&gt;</code> means &quot;Ctrl + v&quot; here. What about a file with 100 such lines? What you do is just to press one more key:</p>
<pre><code>&lt;C-v&gt;24l99jd$p
</code></pre><p>Although these two examples are artificial, they display the powerful functionality of <code>vim</code>, comparing with other editors you have used.</p>
</div></div></p>
<h3 id="enabling-syntax-highlight">Enabling syntax highlight</h3>
<p><code>vim</code> provides more improvements comparing with <code>vi</code>. But these improvements are disabled by default. Therefore, you should enable them first.</p>
<p>We take syntax highlight as an example to illustrate how to enable the features of <code>vim</code>. To do this, you should modify the <code>vim</code> configuration file. The file is called <code>vimrc</code>, and it is located under <code>/etc/vim</code> directory. We first make a copy of it to the home directory by <code>cp</code> command:</p>
<pre><code>cp /etc/vim/vimrc ~/.vimrc
</code></pre><p>And switch to the home directory if you are not under it yet:</p>
<pre><code>cd ~
</code></pre><p>If you use <code>ls</code> to list files, you will not see the <code>.vimrc</code> you just copied. This is because a file whose name starts with a <code>.</code> is a hidden file in GNU/Linux. To show hidden files, use <code>ls</code> with <code>-a</code> option:</p>
<pre><code>ls -a
</code></pre><p>Then open <code>.vimrc</code> using <code>vim</code>:</p>
<pre><code>vim .vimrc
</code></pre><p>After you learn some basic operations in <code>vim</code> (such as moving, inserting text, deleting text), you can try to modify the <code>.vimrc</code> file as following:</p>
<div class="ace"><div class="aceCode" data-config="{&quot;edit&quot;:false,&quot;lang&quot;:&quot;diff&quot;,&quot;check&quot;:false,&quot;theme&quot;:false}">--- before modification
+++ after modification
@@ -17,3 +17,3 @@
 &quot; Vim5 and later versions support syntax highlighting. Uncommenting the next
 &quot; line enables syntax highlighting by default.
-&quot;syntax on
+syntax on<br></div></div>

<p>We present the modification with <a href="http://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html" target="_blank">GNU diff format</a>. Lines starting with <code>+</code> are to be inserted. Lines starting with <code>-</code> are to be deleted. Other lines keep unchanged. If you do not understand the diff format, please search the Internet for more information.</p>
<p>After you are done, you should save your modification. Exit <code>vim</code> and open the <code>vimrc</code> file again, you should see the syntax highlight feature is enabled.</p>
<h3 id="enabling-more-vim-features">Enabling more vim features</h3>
<p>Modify the <code>.vimrc</code> file mentioned above as the following:</p>
<div class="ace"><div class="aceCode" data-config="{&quot;edit&quot;:false,&quot;lang&quot;:&quot;diff&quot;,&quot;check&quot;:false,&quot;theme&quot;:false}">--- before modification
+++ after modification
@@ -21,3 +21,3 @@
 &quot; If using a dark background within the editing area and syntax highlighting
 &quot; turn on this option as well
-&quot;set background=dark
+set background=dark
@@ -31,5 +31,5 @@
 &quot; Uncomment the following to have Vim load indentation rules and plugins
 &quot; according to the detected filetype.
-&quot;if has(&quot;autocmd&quot;)
-&quot;  filetype plugin indent on
-&quot;endif
+if has(&quot;autocmd&quot;)
+  filetype plugin indent on
+endif
@@ -37,10 +37,10 @@
 &quot; The following are commented out as they cause vim to behave a lot
 &quot; differently from regular Vi. They are highly recommended though.
 &quot;set showcmd            &quot; Show (partial) command in status line.
-&quot;set showmatch          &quot; Show matching brackets.
-&quot;set ignorecase         &quot; Do case insensitive matching
-&quot;set smartcase          &quot; Do smart case matching
-&quot;set incsearch          &quot; Incremental search
+set showmatch          &quot; Show matching brackets.
+set ignorecase         &quot; Do case insensitive matching
+set smartcase          &quot; Do smart case matching
+set incsearch          &quot; Incremental search
 &quot;set autowrite          &quot; Automatically save before commands like :next and :make
-&quot;set hidden             &quot; Hide buffers when they are abandoned
+set hidden             &quot; Hide buffers when they are abandoned
 &quot;set mouse=a            &quot; Enable mouse usage (all modes)<br></div></div>

<p>You can append the following content at the end of the <code>.vimrc</code> file to enable more features. Note that contents after a double quotation mark <code>&quot;</code> are comments, and you do not need to include them. Of course, you can inspect every features to determine to enable or not.</p>
<pre><code>setlocal noswapfile &quot; &#x4E0D;&#x8981;&#x751F;&#x6210;swap&#x6587;&#x4EF6;
set bufhidden=hide &quot; &#x5F53;buffer&#x88AB;&#x4E22;&#x5F03;&#x7684;&#x65F6;&#x5019;&#x9690;&#x85CF;&#x5B83;
colorscheme evening &quot; &#x8BBE;&#x5B9A;&#x914D;&#x8272;&#x65B9;&#x6848;
set number &quot; &#x663E;&#x793A;&#x884C;&#x53F7;
set cursorline &quot; &#x7A81;&#x51FA;&#x663E;&#x793A;&#x5F53;&#x524D;&#x884C;
set ruler &quot; &#x6253;&#x5F00;&#x72B6;&#x6001;&#x680F;&#x6807;&#x5C3A;
set shiftwidth=4 &quot; &#x8BBE;&#x5B9A; &lt;&lt; &#x548C; &gt;&gt; &#x547D;&#x4EE4;&#x79FB;&#x52A8;&#x65F6;&#x7684;&#x5BBD;&#x5EA6;&#x4E3A; 4
set softtabstop=4 &quot; &#x4F7F;&#x5F97;&#x6309;&#x9000;&#x683C;&#x952E;&#x65F6;&#x53EF;&#x4EE5;&#x4E00;&#x6B21;&#x5220;&#x6389; 4 &#x4E2A;&#x7A7A;&#x683C;
set tabstop=4 &quot; &#x8BBE;&#x5B9A; tab &#x957F;&#x5EA6;&#x4E3A; 4
set nobackup &quot; &#x8986;&#x76D6;&#x6587;&#x4EF6;&#x65F6;&#x4E0D;&#x5907;&#x4EFD;
set autochdir &quot; &#x81EA;&#x52A8;&#x5207;&#x6362;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x4E3A;&#x5F53;&#x524D;&#x6587;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x76EE;&#x5F55;
set backupcopy=yes &quot; &#x8BBE;&#x7F6E;&#x5907;&#x4EFD;&#x65F6;&#x7684;&#x884C;&#x4E3A;&#x4E3A;&#x8986;&#x76D6;
set hlsearch &quot; &#x641C;&#x7D22;&#x65F6;&#x9AD8;&#x4EAE;&#x663E;&#x793A;&#x88AB;&#x627E;&#x5230;&#x7684;&#x6587;&#x672C;
set noerrorbells &quot; &#x5173;&#x95ED;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#x54CD;&#x94C3;
set novisualbell &quot; &#x5173;&#x95ED;&#x4F7F;&#x7528;&#x53EF;&#x89C6;&#x54CD;&#x94C3;&#x4EE3;&#x66FF;&#x547C;&#x53EB;
set t_vb= &quot; &#x7F6E;&#x7A7A;&#x9519;&#x8BEF;&#x94C3;&#x58F0;&#x7684;&#x7EC8;&#x7AEF;&#x4EE3;&#x7801;
set matchtime=2 &quot; &#x77ED;&#x6682;&#x8DF3;&#x8F6C;&#x5230;&#x5339;&#x914D;&#x62EC;&#x53F7;&#x7684;&#x65F6;&#x95F4;
set magic &quot; &#x8BBE;&#x7F6E;&#x9B54;&#x672F;
set smartindent &quot; &#x5F00;&#x542F;&#x65B0;&#x884C;&#x65F6;&#x4F7F;&#x7528;&#x667A;&#x80FD;&#x81EA;&#x52A8;&#x7F29;&#x8FDB;
set backspace=indent,eol,start &quot; &#x4E0D;&#x8BBE;&#x5B9A;&#x5728;&#x63D2;&#x5165;&#x72B6;&#x6001;&#x65E0;&#x6CD5;&#x7528;&#x9000;&#x683C;&#x952E;&#x548C; Delete &#x952E;&#x5220;&#x9664;&#x56DE;&#x8F66;&#x7B26;
set cmdheight=1 &quot; &#x8BBE;&#x5B9A;&#x547D;&#x4EE4;&#x884C;&#x7684;&#x884C;&#x6570;&#x4E3A; 1
set laststatus=2 &quot; &#x663E;&#x793A;&#x72B6;&#x6001;&#x680F; (&#x9ED8;&#x8BA4;&#x503C;&#x4E3A; 1, &#x65E0;&#x6CD5;&#x663E;&#x793A;&#x72B6;&#x6001;&#x680F;)
set statusline=\ %&lt;%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&amp;fileformat}\ %{&amp;encoding}\ Ln\ %l,\ Col\ %c/%L%) &quot; &#x8BBE;&#x7F6E;&#x5728;&#x72B6;&#x6001;&#x884C;&#x663E;&#x793A;&#x7684;&#x4FE1;&#x606F;
set foldenable &quot; &#x5F00;&#x59CB;&#x6298;&#x53E0;
set foldmethod=syntax &quot; &#x8BBE;&#x7F6E;&#x8BED;&#x6CD5;&#x6298;&#x53E0;
set foldcolumn=0 &quot; &#x8BBE;&#x7F6E;&#x6298;&#x53E0;&#x533A;&#x57DF;&#x7684;&#x5BBD;&#x5EA6;
setlocal foldlevel=1 &quot; &#x8BBE;&#x7F6E;&#x6298;&#x53E0;&#x5C42;&#x6570;&#x4E3A; 1
nnoremap &lt;space&gt; @=((foldclosed(line(&apos;.&apos;)) &lt; 0) ? &apos;zc&apos; : &apos;zo&apos;)&lt;CR&gt; &quot; &#x7528;&#x7A7A;&#x683C;&#x952E;&#x6765;&#x5F00;&#x5173;&#x6298;&#x53E0;
</code></pre><p>If you want to refer different or more settings for <code>vim</code>, please search the Internet. In addition, there are many plug-ins for <code>vim</code> (one of them you may prefer is <code>ctags</code>, which provides the ability to jump among symbol definitions in the code). They make <code>vim</code> more powerful. Also, please search the Internet for more information about <code>vim</code> plug-ins.</p>
<footer class="page-footer-ex"> <span class="page-footer-ex-copyright"> By <a href="https://sashimi-yzh.github.io/" target="_blank">Zihao Yu</a>, &#x91C7;&#x7528;<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/cn/" target="_blank">&#x77E5;&#x8BC6;&#x5171;&#x4EAB; &#x7F72;&#x540D;-&#x975E;&#x5546;&#x4E1A;&#x6027;&#x4F7F;&#x7528;-&#x76F8;&#x540C;&#x65B9;&#x5F0F;&#x5171;&#x4EAB; 3.0 &#x4E2D;&#x56FD;&#x5927;&#x9646; &#x8BB8;&#x53EF;&#x534F;&#x8BAE;</a>&#x53D1;&#x5E03; </span> &#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0; <span class="page-footer-ex-footer-update"> &#x6B64;&#x9875;&#x9762;&#x4FEE;&#x8BA2;&#x4E8E;:  2019-05-03 18:33:11 </span> </footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="0.3.html" class="navigation navigation-prev " aria-label="Previous page: Installing Tools">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="0.5.html" class="navigation navigation-next " aria-label="Next page: More Exploration">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Configuring vim","level":"1.2.4","depth":2,"next":{"title":"More Exploration","level":"1.2.5","depth":2,"path":"0.5.md","ref":"0.5.md","articles":[]},"previous":{"title":"Installing Tools","level":"1.2.3","depth":2,"path":"0.3.md","ref":"0.3.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"3.x.x","theme":"default","variables":{},"plugins":["localized-footer","page-footer-ex","ace","nestedmd","mdinhtml"],"pluginsConfig":{"ace":{},"page-footer-ex":{"copyright":"By [Zihao Yu](https://sashimi-yzh.github.io/), 采用[知识共享 署名-非商业性使用-相同方式共享 3.0 中国大陆 许可协议](http://creativecommons.org/licenses/by-nc-sa/3.0/cn/)发布","markdown":true,"update_format":"YYYY-MM-DD HH:mm:ss","update_label":"此页面修订于: "},"mdinhtml":{},"search":{},"localized-footer":{"filename":"FOOTER.md","hline":"true"},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"nestedmd":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles.css","pdf":"styles.css"}},"file":{"path":"0.4.md","mtime":"2019-05-03T10:33:11.667Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-03T10:36:24.880Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

